From 10d0541c1db0c494ea74e44e464c800b783ef8c8 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 9 Jun 2006 17:05:09 +0100 Subject: [PATCH] [XEN] VCPU operation register_runstate should work even when called from non-local VCPU. Necessary as Linux always calls this operation from VCPU0 during secondary-VCPU bringup. Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 1890956916..b4ad1a7a81 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -377,10 +377,6 @@ arch_do_vcpu_op( { struct vcpu_register_runstate_memory_area area; - rc = -EINVAL; - if ( v != current ) - break; - rc = -EFAULT; if ( copy_from_guest(&area, arg, 1) ) break; @@ -390,7 +386,10 @@ arch_do_vcpu_op( rc = 0; v->runstate_guest = area.addr.v; - __copy_to_user(v->runstate_guest, &v->runstate, sizeof(v->runstate)); + + if ( v == current ) + __copy_to_user(v->runstate_guest, &v->runstate, + sizeof(v->runstate)); break; } -- 2.30.2